<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><title>管理员操作日志</title>
<link rel="stylesheet" href="/layui/css/layui.css"><script src="/static/js/jquery.min.js"></script><script src="/layui/layui.js"></script>
<style>body{background:#f5f5f5;padding:20px;}</style></head>
<body>
<div class="layui-card"><div class="layui-card-header">管理员操作日志</div><div class="layui-card-body">
<div class="layui-form layui-form-pane" style="margin-bottom:15px;"><div class="layui-inline"><input type="text" id="keyword" placeholder="操作关键词" class="layui-input" value="<?= htmlspecialchars($keyword) ?>"></div><div class="layui-inline"><input type="text" id="startTime" placeholder="开始日期" class="layui-input" value="<?= htmlspecialchars($startTime) ?>" style="width:130px;"></div><div class="layui-inline"><input type="text" id="endTime" placeholder="结束日期" class="layui-input" value="<?= htmlspecialchars($endTime) ?>" style="width:130px;"></div><button class="layui-btn layui-btn-primary layui-btn-sm" onclick="search()">搜索</button></div>
<table class="layui-table" lay-size="sm"><thead><tr><th>ID</th><th>管理员</th><th>操作动作</th><th>操作内容</th><th>IP</th><th>时间</th></tr></thead>
<tbody><?php foreach($list as $item): ?><tr><td><?= $item['id'] ?></td><td><?= $item['admin_name'] ?></td><td><?= $item['action'] ?></td><td><?= htmlspecialchars($item['content'] ?? '') ?></td><td><?= $item['ip'] ?></td><td><?= $item['create_time'] ?></td></tr><?php endforeach; ?><?php if(empty($list)):?><tr><td colspan="6" style="text-align:center;color:#999;">暂无数据</td></tr><?php endif;?></tbody></table><div id="page"></div></div></div>
<script>
var total=<?=$total?>,page=<?=$page?>,pageSize=<?=$pageSize?>;
layui.use(['laypage','laydate'],function(){var p=layui.laypage,d=layui.laydate;d.render({elem:'#startTime',type:'date'});d.render({elem:'#endTime',type:'date'});if(total>pageSize){p.render({elem:'page',count:total,limit:pageSize,curr:page,jump:function(o,f){if(!f) location.href='/admin/log/adminLog?page='+o.curr+'&keyword=<?=urlencode($keyword)?>&start_time=<?=urlencode($startTime)?>&end_time=<?=urlencode($endTime)?>';}});}});
function search(){location.href='/admin/log/adminLog?keyword='+encodeURIComponent($('#keyword').val())+'&start_time='+encodeURIComponent($('#startTime').val())+'&end_time='+encodeURIComponent($('#endTime').val());}
</script></body></html>